<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1{
            width: 100px;
            height: 100px;
            background-color: aquamarine;
            position: absolute;
            top: 100px;
        }
    </style>
</head>
<body>
    <div class="div1"></div>
    <div id="btn">点击</div>
</body>
<script src="./animate.js"></script>
<script>
    let div = document.querySelector('div');
    document.querySelector('#btn').addEventListener('click',function(){
        animate(div,800)
    })
</script>
</html>